projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe592cd
)
text: Ensure indexes are ordered properly
author
Benjamin Otte
<otte@redhat.com>
Sat, 18 May 2019 14:20:39 +0000
(16:20 +0200)
committer
Benjamin Otte
<otte@redhat.com>
Sat, 18 May 2019 15:06:08 +0000
(17:06 +0200)
gtk/gtktext.c
patch
|
blob
|
history
diff --git
a/gtk/gtktext.c
b/gtk/gtktext.c
index f026ead3ae760ee417f9b6269b88ea8360401b8e..49e127156878e656ce73f7b422af13ce9bfd4bd9 100644
(file)
--- a/
gtk/gtktext.c
+++ b/
gtk/gtktext.c
@@
-2260,7
+2260,11
@@
gtk_text_get_pixel_ranges (GtkText *self,
int end_index = g_utf8_offset_to_pointer (text, priv->current_pos) - text;
int real_n_ranges, i;
- pango_layout_line_get_x_ranges (line, start_index, end_index, ranges, &real_n_ranges);
+ pango_layout_line_get_x_ranges (line,
+ MIN (start_index, end_index),
+ MAX (start_index, end_index),
+ ranges,
+ &real_n_ranges);
if (ranges)
{